package net.area80.utils
{
	public class ArrayUtils
	{
		public static function randomSelect (ary:Array):* {
			var rand:uint = Math.round(Math.random()*(ary.length-1));
			return ary[rand];
		}
		public static function removeDuplicate(ac:*):void {

				var deleted:Boolean=false;

				for (var i:Number=0; i<ac.length-1; i++) {
					for (var j:Number = i + 1; j < ac.length; j++) {
						if (ac[i]===ac[j]) {
							ac.splice(j, 1);
							
							deleted=true;
						}
					}
				}
				
				if (deleted) {
					ArrayUtils.removeDuplicate(ac);
				}
			
		}
	}
}